<template>
  <!-- 仅服务于带icon的el-button，用法同el-icon，但是进行了优化 -->
  <el-icon v-bind="$attrs" v-on="$attrs" :class="iconClass">
    <slot />
  </el-icon>
</template>
<script lang="ts">
export default {
  //组件名称
  name: 'ComIcon',
}
</script>
<script lang="ts" setup>
import { computed } from 'vue'
const props = defineProps({
  right: {
    type: Boolean,
    required: false,
    default: false,
  },
})

const iconClass = computed(() => {
  return props.right ? 'el-icon--right' : 'el-icon--left'
})
</script>

<style lang="scss"></style>
